package com.hema.auction.adapter;

import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.hema.auction.R;
import com.hema.auction.fragment.DealInfo;
import com.hema.auction.utils.GlideUtils;
import com.hema.auction.utils.Utils;

import java.util.List;

/**
 * author by john
 */

public class OldOrdersAdapter extends BaseQuickAdapter<DealInfo, BaseViewHolder> {
    public OldOrdersAdapter(List<DealInfo> data) {
        super(R.layout.layout_old_orders_item, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, DealInfo item) {
        helper.setText(R.id.tv_dealer, item.getUserName());
        helper.setText(R.id.tv_market_price, Utils.priceUnitFormat(mContext, item.getPrice()));
        helper.setText(R.id.tv_deal_price, Utils.priceUnitFormat(mContext, item.getFinalPrice()));
        helper.setText(R.id.tv_save, Utils.savaFormat(mContext,item.getFinalPrice(),item.getPrice()));
        helper.setText(R.id.tv_date, Utils.timedate(item.getFinalTime()));
        ImageView view = helper.getView(R.id.iv_img);
        GlideUtils.load(mContext,item.getFacePic(),view);
//        Glide.with(mContext).load(item.getImg()).placeholder(R.drawable.ic_defaul_image).into(view);

    }

}
